var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
    })(e, t);
}, function(e, t) {
    function n() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (n.prototype = t.prototype, 
    new n());
}), a = this && this.__decorate || function(e, t, n, o) {
    var a, r = arguments.length, i = r < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, n) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(e, t, n, o); else for (var l = e.length - 1; 0 <= l; l--) (a = e[l]) && (i = (r < 3 ? a(i) : 3 < r ? a(t, n, i) : a(t, n)) || i);
    return 3 < r && i && Object.defineProperty(t, n, i), i;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("GameData"), s = e("AudioManager"), c = e("RoleManager"), l = e("UIManager"), d = e("WebManager"), u = e("PrefabView"), p = e("HpView"), h = e("SkinView"), f = e("PersonView"), g = cc._decorator, m = g.ccclass, y = g.property, v = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.personView = null, e.hpView = null, e.atkLabel = null, e.speLabel = null, 
        e.ranLabel = null, e.criLabel = null, e.movLabel = null, e.idx = 128, e;
    }
    return i(e, t), e.prototype.onClickChange = function() {
        s.default.getInstance().playAudio("按扭2"), d.default.getInstance().sentLog("点击新年活动获得超级皮肤界面替换上阵按键"), 
        l.default.getInstance().hideAllPnl(), l.default.getInstance().showPnl("start");
    }, e.prototype.start = function() {
        this.init();
    }, e.prototype.init = function(e, t) {
        void 0 === e && (e = r.GD.gunIdx), this.idx = t = void 0 === t ? -29 : t, this.refreshLabel(this.getValue(this.checkGunIdx(e), t)), 
        this.personView.init(t, this.checkGunIdx(e));
    }, e.prototype.refreshLabel = function(e) {
        void 0 === e && (e = c.default.getInstance().value), this.atkLabel.string = e.atk.toString(), 
        this.speLabel.string = e.spe.toString(), this.ranLabel.string = e.ran.toString(), 
        this.criLabel.string = e.cri + "%", this.movLabel.string = e.mov.toString(), this.hpView.init(e.hp);
    }, e.prototype.checkGunIdx = function(e) {
        return 2001 == r.GD.gunIdx ? 3 == e || 9 == e ? r.GD.gunIdx : r.GD.topRank : 1008 != r.GD.gunIdx || -17 == e ? r.GD.gunIdx : r.GD.topRank;
    }, e.prototype.setValue = function(e) {
        c.default.getInstance().value = e;
    }, e.prototype.getValue = function(e, t) {
        var n = c.default.getInstance().getAtk(e, t), o = 10 * Math.floor(10 / c.default.getInstance().getSpe(e, t)), a = c.default.getInstance().getRan(e), r = c.default.getInstance().getCri(e, t), i = c.default.getInstance().getMove(e, t), t = c.default.getInstance().getHp(e, t);
        return new h.SkinItemValue(n, o, a, r, i, t);
    }, a([ y(f.default) ], e.prototype, "personView", void 0), a([ y(p.default) ], e.prototype, "hpView", void 0), 
    a([ y(cc.Label) ], e.prototype, "atkLabel", void 0), a([ y(cc.Label) ], e.prototype, "speLabel", void 0), 
    a([ y(cc.Label) ], e.prototype, "ranLabel", void 0), a([ y(cc.Label) ], e.prototype, "criLabel", void 0), 
    a([ y(cc.Label) ], e.prototype, "movLabel", void 0), a([ m ], e);
}(u.default);

n.default = v;